:- use_package(persdb).

:- use_module(amos(configuration),[save_data_dir/1, db_dir_perms/1, db_file_perms/1]).

%%kludge to make it work in ciao 1.9 with old persdb.
persistent_dir(amosdb,Dir,DirPerms,FilePerms):-
	save_data_dir(Dir),
	db_dir_perms(DirPerms),
	db_file_perms(FilePerms).
%%
persistent_dir(amosdb,Dir):-
	save_data_dir(Dir).


:- persistent(identificationtags/3,amosdb).
:- persistent(requires/3,amosdb).
:- persistent(uses/3,amosdb).
:- persistent(cert_status/2,amosdb).

:- persistent(synonyms/2,amosdb).
:- persistent(generalizations/2,amosdb).
:- persistent(translations/3,amosdb).
:- persistent(authors/2,amosdb).
:- persistent(maintainers/2,amosdb).
:- persistent(descriptions/2,amosdb).

:- persistent(asset/19,amosdb).
:- persistent(resource/6,amosdb).
:- persistent(certification/10,amosdb).
:- persistent(ditem/3,amosdb).
:- persistent(organization/2,amosdb).
:- persistent(user/3,amosdb).

% If any operation is needed when a program using this module has finished editing 
% the database, it must be done here.
update_db:-
	update_files([
			 identificationtags/3,
			 requires/3,
			 uses/3,
			 cert_status/2,
			 synonyms/2,
			 generalizations/2,
			 translations/3,
			 authors/2,
			 maintainers/2,
			 descriptions/2,
			 asset/19,
			 resource/6,
			 certification/10,
			 ditem/3,
			 organization/2,
			 user/3
		     ]).



